package com.dt76.smallloanfrontendservice.controller.linte;

import com.dt76.smallloanfrontendservice.pojo.linte.RepaymentInfo;
import com.dt76.smallloanfrontendservice.service.linte.RepaymentService;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

@RestController
public class RepaymentController {

    private final RepaymentService repaymentService ;

    public RepaymentController(RepaymentService repaymentService) {
        this.repaymentService = repaymentService;
    }

    @RequestMapping("/getList")
    public List<RepaymentInfo> getList(Integer userId){
        return repaymentService.qryAll(userId);
    }

    @RequestMapping("/doneRep")
    public Integer doneRep(Integer repId){
        return repaymentService.doneRep(repId);
    }
}
